home *** CD-ROM | disk | FTP | other *** search
- import java.io.DataInputStream;
- import java.io.File;
- import java.io.FileInputStream;
- import vrml.BaseNode;
- import vrml.Browser;
- import vrml.Event;
- import vrml.node.Script;
-
- public class Motd extends Script {
- String myFile = "C:/tmp/motd";
- // $FF: renamed from: b vrml.Browser
- Browser field_0;
- // $FF: renamed from: in java.io.DataInputStream
- DataInputStream field_1;
- String message;
-
- public void initialize() {
- this.field_0 = ((BaseNode)this).getBrowser();
- }
-
- public void processEvent(Event var1) {
- File var2 = null;
- if (var1.getName().equals("clicked")) {
- try {
- var2 = new File(this.myFile);
- this.field_1 = new DataInputStream(new FileInputStream(var2));
- } catch (Exception var5) {
- this.field_0.setDescription("can not open file: " + this.myFile);
- ((Throwable)var5).printStackTrace();
- }
-
- try {
- if (var2.exists()) {
- this.message = this.field_1.readLine();
- this.field_0.setDescription(this.message);
- } else {
- this.field_0.setDescription("file does not exists: " + this.myFile);
- }
- } catch (Exception var4) {
- ((Throwable)var4).printStackTrace();
- }
- }
- }
- }
-